package com.fwmagic.redis;

import redis.clients.jedis.Jedis;

import java.util.Set;

public class SetValue {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.62.131", 6379, 5000);

        //插入会自动去重
        jedis.sadd("frame","flink","spark","hive","hive");

        //取出所有数据
        Set<String> smembers = jedis.smembers("frame");

        smembers.forEach(System.out::println);

        //删除一个
        jedis.srem("frame","hive");

        //判断是否存在
        Boolean aBoolean = jedis.sismember("frame", "spark");
        System.out.println(aBoolean);

        jedis.close();
    }
}
